<html>
<head><meta charset="utf-8"><title>miri — macOS environment · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html">miri — macOS environment</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="167002864"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167002864" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167002864">(May 31 2019 at 14:44)</a>:</h4>
<div class="codehilite"><pre><span></span>error[E0080]: Miri evaluation error: can&#39;t call foreign function: _NSGetEnviron
   --&gt; /Users/shep/.rustup/toolchains/nightly-2019-05-27-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/os.rs:405:5
    |
405 |     _NSGetEnviron()
    |     ^^^^^^^^^^^^^^^ Miri evaluation error: can&#39;t call foreign function: _NSGetEnviron
    |
    = note: inside call to `std::sys::unix::os::environ` at /Users/shep/.rustup/toolchains/nightly-2019-05-27-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/sys/unix/os.rs:426:28
    = note: inside call to `std::sys::unix::os::env` at /Users/shep/.rustup/toolchains/nightly-2019-05-27-x86_64-apple-darwin/lib/rustlib/src/rust/src/libstd/env.rs:143:21
</pre></div>


<p><span class="user-mention" data-user-id="120791">@RalfJ</span> should I report this? seems like <code>env</code> should be supported (and I assume it is on Linux)</p>



<a name="167003197"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167003197" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167003197">(May 31 2019 at 14:48)</a>:</h4>
<p>uh, I thought we had a test for that</p>



<a name="167003241"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167003241" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167003241">(May 31 2019 at 14:48)</a>:</h4>
<p>yeah we test</p>
<div class="codehilite"><pre><span></span><span class="k">fn</span> <span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">assert_eq</span><span class="o">!</span><span class="p">(</span><span class="n">env</span>::<span class="n">var</span><span class="p">(</span><span class="s">&quot;MIRI_TEST&quot;</span><span class="p">),</span><span class="w"> </span><span class="nb">Err</span><span class="p">(</span><span class="n">env</span>::<span class="n">VarError</span>::<span class="n">NotPresent</span><span class="p">));</span><span class="w"></span>
<span class="w">    </span><span class="n">env</span>::<span class="n">set_var</span><span class="p">(</span><span class="s">&quot;MIRI_TEST&quot;</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;the answer&quot;</span><span class="p">);</span><span class="w"></span>
<span class="w">    </span><span class="n">assert_eq</span><span class="o">!</span><span class="p">(</span><span class="n">env</span>::<span class="n">var</span><span class="p">(</span><span class="s">&quot;MIRI_TEST&quot;</span><span class="p">),</span><span class="w"> </span><span class="nb">Ok</span><span class="p">(</span><span class="s">&quot;the answer&quot;</span><span class="p">.</span><span class="n">to_owned</span><span class="p">()));</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>what code are you running to trigger this?</p>



<a name="167003266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167003266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167003266">(May 31 2019 at 14:49)</a>:</h4>
<p>And you run the tests on macOS?</p>



<a name="167003272"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167003272" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167003272">(May 31 2019 at 14:49)</a>:</h4>
<p>(so, yes, please report with a reproducing testcase)</p>



<a name="167003274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167003274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167003274">(May 31 2019 at 14:49)</a>:</h4>
<p>yes</p>



<a name="167003307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167003307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167003307">(May 31 2019 at 14:49)</a>:</h4>
<p>This is in the proptest code, but they call <code>vars_os</code></p>



<a name="167003324"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167003324" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167003324">(May 31 2019 at 14:50)</a>:</h4>
<p>I'll see about a smaller case</p>



<a name="167003622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167003622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167003622">(May 31 2019 at 14:53)</a>:</h4>
<p>Filed as <a href="https://github.com/rust-lang/miri/issues/756" target="_blank" title="https://github.com/rust-lang/miri/issues/756">https://github.com/rust-lang/miri/issues/756</a> — any other deets I'm missing?</p>



<a name="167004500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167004500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167004500">(May 31 2019 at 15:04)</a>:</h4>
<p>no looks good</p>



<a name="167004521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/miri%20%E2%80%94%20macOS%20environment/near/167004521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/miri.20.E2.80.94.20macOS.20environment.html#167004521">(May 31 2019 at 15:04)</a>:</h4>
<p>hm so maybe this is about enumerating env vars vs accessing a particular one</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>